package com.example.lanqiaodemo1.JavaTest4;

public class CircleClass extends ShapeClass{
    public double r;
    public CircleClass(double r) {
        this.r = r;
    }
    public CircleClass(){}
    @Override
    public double getArea() {
        return Math.PI * r * r;
    }
    @Override
    public double getPerimeter() {
        return 2 * Math.PI * r;
    }
}
class test2{
    public static void main(String[] args) {
        CircleClass circle = new CircleClass(2);
        System.out.println(circle.getArea());
        System.out.println(circle.getPerimeter());
    }
}
